package test;

import keter.starter.demo.Demo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author hourui 2017/10/10 16:48
 */
@SpringBootApplication
public class DemoApp implements CommandLineRunner {

    private static final Logger logger = LoggerFactory.getLogger(DemoApp.class);
    /* 使用Starters提供的Demo */
    @Autowired  Demo demo;

    @Autowired private MyDemo myApp;

    public static void main(String[] args) {
        SpringApplication.run(DemoApp.class, args);
    }

    public void run(String... strings) throws Exception {
        logger.info("demo url, 默认为 [haha] : {}",demo.getUrl());
        myApp.haha();
    }
}
